//
//  userViewController.m
//  简单豆瓣不得不交版 1 带
//
//  Created by dllo on 16/6/23.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "userViewController.h"
#import "userTableViewCell.h"
#import "userModel.h"
#import "SignViewController.h"

static NSString *const cellActviity = @"CELL";

@interface userViewController ()<UITableViewDelegate, UITableViewDataSource>

@property(nonatomic, retain)UITableView *myTableView;
@property(nonatomic, retain)NSMutableArray *myArray;


@end

@implementation userViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
    self.myArray = [NSMutableArray array];
    
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0, 200, 44)];
    titleLabel.font = [UIFont boldSystemFontOfSize:20];
    titleLabel.textColor = [UIColor blackColor];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text = @"电影";
    self.navigationItem.titleView = titleLabel;
    [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:0.3490 green:0.6118 blue:0.6706 alpha:1.000]];
    
    [self handleGata];
    [self creatTableView];

    
    self.navigationItem.rightBarButtonItem =  [[UIBarButtonItem alloc]initWithTitle:@"登录" style:UIBarButtonItemStylePlain target:self action:@selector(rightAction:)];
    
    
}

- (void)rightAction:(UIBarButtonItem *)item {
    SignViewController *sigVC = [[SignViewController alloc] init];
    [self.navigationController pushViewController:sigVC animated:YES];
    
    
    
    
    
}


- (void)creatTableView {
    
    self.myTableView = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen]bounds] style:UITableViewStylePlain];
    self.myTableView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.myTableView];
    [_myTableView release];
    
    self.myTableView.delegate = self;
    self.myTableView.dataSource = self;
    
    [self.myTableView registerClass:[userTableViewCell class] forCellReuseIdentifier:cellActviity];
    
    
}

- (void)handleGata {
    
   
    
    
}




- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    userTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellActviity forIndexPath:indexPath];
    
  //  userModel *model = [self.myArray objectAtIndex:indexPath.row];
    if (indexPath.row == 0) {
        cell.textLabel.text = @"我的";
        
        return cell;

    }else if (indexPath.row == 1)
       {
        
        cell.textLabel.text = @"我的电影";
        
           return cell;

    }else if(indexPath.row == 2)
    
    cell.textLabel.text = @"清楚缓存";
    //  取消uitableviewcell的点以效果
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 3;
}


-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 60;
}

















- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
